<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function person(name,age)
			{
				this.name=name;
				this.age=age;
			}
			var per1 =new person("林润钿",18);
			var per2=new person("戴阳",22);
			var per3=new person("张恩博",30);
			var per4=new person("梁桂平",31);
			var perarr=[per1,per2,per3,per4];
		   function getfun(arr)
		   {
			  var arr1=[];
			  for(var i=0;i<arr.length;i++)
			  {
				  var p=arr[i];
				  if(p.age<30)
				  {
					  arr1.push(p);  //为什么不能加this，this是对象的this，这只是个数组，又不是哪个对象的属性
				  }
			  }
			 return arr1;
		    }
			console.log(getfun(perarr));
		</script>
	</head>
	<body>
	</body>
</html>